﻿@model IEnumerable<PrjctMngmt.Models.TaskAssignment>

@{
    ViewBag.Title = "Task assignments";
    var odd = false;
}

@if (Model.Count() > 0)
{
    <div class="datagrid">
    <table>
    <thead>
        <tr>
            <th>
                Task
            </th>
            <th>
                Developer
            </th>
            <th>
            </th>
        </tr>
        </thead>
        @foreach (var item in Model)
        {
            <tbody>
            <tr class="@(odd ? "alt" : "")">
                <td>
                    @Html.DisplayFor(modelItem => item.Task.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Developer.FirstName)
                    @Html.DisplayFor(modelItem => item.Developer.LastName)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.TaskAssignmentID }) |
                    @Html.ActionLink("Details", "Details", new { id = item.TaskAssignmentID }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.TaskAssignmentID })
                </td>
            </tr>
            @{ odd = !odd; }
            </tbody>
        }
    </table>
    @{ odd = false; }
    </div>
}
else
{
    <p>
        No task assignments found.
    </p>
}
<div>
    <br />
    @Html.ActionLink("Back to tasks", "Index", "Task")
</div>
